<%--
 *  File:    ProdEdit.jsp
 *  @Author: Langerwang 
 *  Date:    2001/01/14
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  //init param
  Category cat = Category.getInstance("jsp.ProdEdit");  
  String privilegeCode = "10203,L203";
  String strModuleName = "PCM";
  String strTableName = "ovproduct";
%>

<%
  HashMap userInfo = (HashMap)session.getAttribute("userinfo");
  Integer nCurOrgId = (Integer)userInfo.get("orgid");
%>
<%--
Enumeration en = request.getParameterNames();
while(en.hasMoreElements())
  System.out.println("0 "+en.nextElement());
--%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/PageDefault.inc" %>

<html>
<head>
<title>ProdEdit</title>
<PageFlow:CheckPageFlow pageName="prodedit"/>
<%
  HashMap prodInfo = (HashMap)pageContext.getAttribute("productinfo");
  
  if (prodInfo == null) prodInfo = new HashMap();
  
  boolean isProdConfigControl = pageContext.getAttribute("isprodconfigcontrol") != null && ((String)pageContext.getAttribute("isprodconfigcontrol")).equalsIgnoreCase("Y");
  boolean isConfigControl = prodInfo.get("isconfigcontrol") != null && ((String)prodInfo.get("isconfigcontrol")).equalsIgnoreCase("Y") && prodInfo.get("prodlistconfigid") != null && prodInfo.get("prodlistconfigid").toString().length() > 0;
%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../../css/<%= strLanguageCode %>/script.js"></script>

<%  
    String stdnew = (String)pageContext.getAttribute("stdnew");
    if(stdnew == null) 
    {
        stdnew = (String)session.getAttribute("stdnew");
    }
    if(stdnew == null) stdnew = "";
    if((String)session.getAttribute("stdnew") != null) session.removeAttribute("stdnew");
    
  	Vector errorCode = (Vector)session.getAttribute("errorcode");
  	cat.debug(session.getAttribute("errorcode"));
  	cat.debug("find errorcode->" + errorCode);
  	if(errorCode != null && errorCode.size() != 0) { %>		
  		<script>
			parent.frmset.rows="0%,100%";
			parent.down.location.href="<%= ConstantProp.DEFAULT_ROOT_PATH %>/Error.jsp?<%= OvalTools.randomURL() %>";
		</script>
<%	}else if( stdnew.equalsIgnoreCase("Y") )
    {%>
		<script>
		  var link="ProdConfigEdit.jsp?<%= OvalTools.randomURL() %>&prodid=<custom:write  property="prodid"/>&languagecode=<%= strLanguageCode %>&orgid=<%=JspHelper.filterNull( nCurOrgId )%><%=JspHelper.filterNull((request.getParameter("isnew")==null)?"":("&isnew="+request.getParameter("isnew")))%>";
		  link+="&orderbycolumn=<custom:write  property="orderbycolumn"/>&orderbytype=<custom:write  property="orderbytype"/>&jumppage=<custom:write  property="currentpage"/>&selectopt=<custom:write property="selectopt"/>&categoryid=<custom:write property="categoryid"/>&categoryorgid=<custom:write property="categoryorgid"/>&orgid=<custom:write property="orgid"/>&searchname=<oval:write property="searchname"/>&searchvalue=<oval:write property="searchvalue"/>";
			parent.down.location.href=link;
		</script>
    <%}
    else
    {%>
		<script>
		  var link="ProdEditMain.jsp?<%= OvalTools.randomURL() %>&prodid=<custom:write  property="prodid"/>&languagecode=<%= strLanguageCode %>&orgid=<%=JspHelper.filterNull( nCurOrgId )%><%=JspHelper.filterNull((request.getParameter("isnew")==null)?"":("&isnew="+request.getParameter("isnew")))%>";
		  link+="&orderbycolumn=<custom:write  property="orderbycolumn"/>&orderbytype=<custom:write  property="orderbytype"/>&jumppage=<custom:write  property="currentpage"/>&selectopt=<custom:write property="selectopt"/>&categoryid=<custom:write property="categoryid"/>&categoryorgid=<custom:write property="categoryorgid"/>&orgid=<custom:write property="orgid"/>&searchname=<oval:write property="searchname"/>&searchvalue=<oval:write property="searchvalue"/>";
			parent.down.location.href=link;
		</script>
<% 	} %>
<script language="JavaScript">
function page_downhref(url,imgname)
{
<%
  if(request.getParameter("isnew")!=null && ((String)request.getParameter("isnew")).equals("Y")){
%>
  alert('<%=message.getMessageDesc("SAVE_INFO_FIRST")%>');
  return;
<%}%>
  
  var link=url;
  link+="&orderbycolumn=<custom:write  property="orderbycolumn"/>&orderbytype=<custom:write  property="orderbytype"/>&jumppage=<custom:write  property="currentpage"/>&selectopt=<custom:write property="selectopt"/>&categoryid=<custom:write property="categoryid"/>&categoryorgid=<custom:write property="categoryorgid"/>&orgid=<custom:write property="orgid"/>&searchname=<oval:write property="searchname"/>&searchvalue=<oval:write property="searchvalue"/>";
  parent.down.location.href=link;
}
function page_summary(actionvalue,orderbyname)
{
  <%
  if(request.getParameter("isnew")!=null && ((String)request.getParameter("isnew")).equals("Y")){
%>
  alert('<%=message.getMessageDesc("SAVE_INFO_FIRST")%>');
  return;
<%}%>
  var editform = summaryPrepare(thisform,actionvalue,orderbyname);
  editform.action = "ProdEdit.jsp?<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();
}
function page_goback()
{
  <%if(stdnew.equalsIgnoreCase("Y") || stdnew.equalsIgnoreCase("N") ){%>
      parent.location.href="StdProdMgmtFrm.jsp?<%= OvalTools.randomURL() %>";
  <%}else{%>
      parent.location.href="ProdMgmtFrm.jsp?<%= OvalTools.randomURL() %>";
  <%}%>
}

</script>
</head>
<body>

<table width="100%" cellspacing="0" border="0" cellpadding="0">
<form name="thisform" method="post" action="../../Dispatcher" target="_self">
      <input type="hidden" name="pagename" value="prodedit">
      <input type="hidden" name="actionname">
      <custom:hidden name="productinfo" property="prodid"/>
      <custom:hidden property="languagecode" scope="session"/>
      <custom:hidden property="orgid"/>
      <custom:hidden property="categoryorgid"/>
      <custom:hidden property="categoryid"/>
      <custom:hidden property="selectopt"/>
  <tr>
    <td class="summary_top"></td>
  </tr>
   <!-- 
  <tr> 
    <td>
    <%@ include file="/inc/QuickGoTo.inc" %>
      <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
        
        <tr  class="td-listrom" > 
          <td class="td_right"  width="15%"><%= label.getLabelName("L_ProdCode")+label.getLabelName("L_Colon") %></td>
          <td >&nbsp;<oval:write name="productinfo" property="prodcode"/></td>
        </tr>
        
      </table>
         
      <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr> 
          <td style="PADDING-BOTTOM: 0px; PADDING-LEFT: 1px; PADDING-RIGHT: 1px; PADDING-TOP: 0px" class="black_line"> 
            
            <table width="100%" cellspacing="0" cellpadding="0">
              <tbody> 
              <tr> 
                <td class=black_line height="1"></td>
              </tr>
               
               <tr> 
                 <td bgcolor=#ffffff class=m_title>&nbsp;</td>
               </tr>
              
               <tr> 
                <td background=../../images/<%= strLanguageCode %>/M_bg.gif  bgcolor=#ffffff valign="bottom"> 
                  <table border=0 cellpadding=0 cellspacing=0>
                    <tbody> 
                    
                    <tr> 
                      <td><img height=20 src="" width=1></td>
                      <td class="hand1" valign=bottom  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif" onclick="javascript:switchTags(this);page_downhref('ProdEditMain.jsp?<%= OvalTools.randomURL() %>&prodid=<custom:write  property="prodid"/>&languagecode=<%= strLanguageCode %>&orgid=<%=JspHelper.filterNull( nCurOrgId )%>','Msummary');"><div align=center><%=label.getLabelName("L_Summary")%></div></td>
                     
                     <td class="hand1" valign=bottom  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif" onclick="javascript:switchTags(this);page_downhref('ProdEditDesc.jsp?<%= OvalTools.randomURL() %>&prodid=<custom:write  property="prodid"/>&languagecode=<%= strLanguageCode %>&orgid=<%=JspHelper.filterNull( nCurOrgId )%>','MRecount');"><div align=center><%=label.getLabelName("L_Recount")%></div></td>
                      <td class="hand1" valign=bottom  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif" onclick="javascript:switchTags(this);page_downhref('ProdEditLifecycle.jsp?<%= OvalTools.randomURL() %>&prodid=<custom:write  property="prodid"/>&languagecode=<%= strLanguageCode %>&orgid=<%=JspHelper.filterNull( nCurOrgId )%>','Mlifeweek');"><div align=center><%=label.getLabelName("L_Lifeweek")%></div></td>
                      <td class="hand1" valign=bottom  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif" onclick="javascript:switchTags(this);page_downhref('ProdEditPack.jsp?<%= OvalTools.randomURL() %>&prodid=<custom:write  property="prodid"/>&languagecode=<%= strLanguageCode %>&orgid=<%=JspHelper.filterNull( nCurOrgId )%>','boxup');"><div align=center><%=label.getLabelName("L_Pack")%></div></td>
                      <td class="hand1" valign=bottom  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif" onclick="javascript:switchTags(this);page_downhref('ProdEditUM.jsp?<%= OvalTools.randomURL() %>&prodid=<custom:write  property="prodid"/>&languagecode=<%= strLanguageCode %>&orgid=<%=JspHelper.filterNull( nCurOrgId )%>','MUM');"><div align=center><%=label.getLabelName("L_UM")%></div></td>
                      <td class="hand1" valign=bottom  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif" onclick="javascript:switchTags(this);page_downhref('ProdEditOther.jsp?<%= OvalTools.randomURL() %>&prodid=<custom:write  property="prodid"/>&languagecode=<%= strLanguageCode %>&orgid=<%=JspHelper.filterNull( nCurOrgId )%>','MExinfo');"><div align=center><%=label.getLabelName("L_MExinfo")%></div></td>
                      <td class="hand1" valign=bottom  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif" onclick="javascript:switchTags(this);page_downhref('ProdEquipmentEdit.jsp?<%= OvalTools.randomURL() %>&prodid=<custom:write  property="prodid"/>&languagecode=<%= strLanguageCode %>&orgid=<%=JspHelper.filterNull( nCurOrgId )%>','ProdEquipmentEdit');"><div align=center><%=label.getLabelName("L_OtherInfo")%></div></td>
                      <td class="hand1" valign=bottom  width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif" onclick="javascript:switchTags(this);page_downhref('ProdPriceInfo.jsp?<%= OvalTools.randomURL() %>&prodid=<custom:write  property="prodid"/>&languagecode=<%= strLanguageCode %>&orgid=<%=JspHelper.filterNull( nCurOrgId )%>','ProdPriceInfo');"><div align=center><%=label.getLabelName("L_PriceInfo")%></div></td>
                      <%if(isProdConfigControl && isConfigControl){%>
                      <td class="hand1" valign=bottom width="78" background="../../images/<%= strLanguageCode %>/mark_bg.gif" onclick="javascript:switchTags(this);page_downhref('ProdConfigEdit.jsp?<%= OvalTools.randomURL() %>&prodid=<custom:write  property="prodid"/>&languagecode=<%= strLanguageCode %>&orgid=<%=JspHelper.filterNull( nCurOrgId )%>','Mconfig');"><div align=center><%=label.getLabelName("L_ProdAttribute")%></div></td>
                      <%}else{%>
                      <td valign=bottom>&nbsp;</td>
                      <%}%>
                      
                      <td valign=bottom>&nbsp;</td>
                      
                      <td valign=bottom>&nbsp;</td>
                      <td valign=bottom>&nbsp;</td>
                      <td valign=bottom>&nbsp;</td>
                    
                    </tr>
                   
                    </tbody>
                 </table>
                </td>
              </tr>
                
              </tbody>  
            </table>
          </td>
        </tr>
      </table>
     
    </td>
  </tr>
   -->
  </form> 
</table>
</body>
</html>


